package com.design.designmode.action.interceptor;

/**
 * @author hxl
 * @since 2023-04-18
 */
public class NonterminalExprssion implements Expression {
    private TerminalExpression region;
    private TerminalExpression person;

    public NonterminalExprssion(TerminalExpression region, TerminalExpression person) {
        this.region = region;
        this.person = person;
    }


    @Override
    public boolean Interpret(String info) {
        String[] str = info.split("的");
        // B区的调试人员 --> str = {"B区", "调试人员"}

        return region.Interpret(str[0]) && person.Interpret(str[1]);

    }
}
